﻿using LiveCharts.Wpf;
using LiveCharts;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace CustomLesson.ChartLib
{
    /// <summary>
    /// ChartTestWindow.xaml 的交互逻辑
    /// </summary>
    public partial class ChartTestWindow : Window
    {
        public SeriesCollection SeriesList { get; set; } = new SeriesCollection();

        // Y轴Label的显示格式
        public Func<double, string> YLabelFormatter { get; set; } = d => d.ToString("0.00");

        public ChartTestWindow()
        {
            InitializeComponent();

            this.DataContext = this;

            //YLabelFormatter = YLabelFormatterFunc;

            SeriesList.Add(new LineSeries
            {
                Values = new ChartValues<double> { 0.89, 0.66, 0.99, 0.27, 0.34, 0.17, 0.81, 0.87, 0.10, 0.78, 0.63, 0.86, 0.93, 0.7, 0.24, 1, 0.13, 0.21, 0.52, 0.37 },
                Title = "压力",
                Stroke = Brushes.Green
            });

        }
    }
}
